using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class RenumBatchMap : EntityTypeConfiguration<RenumBatch>
    {
        public RenumBatchMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.oldbatch)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.newbatch)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.period)
                .HasMaxLength(4);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("RenumBatch");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.oldbatch).HasColumnName("oldbatch");
            this.Property(t => t.newbatch).HasColumnName("newbatch");
            this.Property(t => t.period).HasColumnName("period");
            this.Property(t => t.date).HasColumnName("date");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
        }
    }
}
